{eq name="Request.action" value="edit"}
{Data:article name="Article" id="request" var="vo"}
{else /}
{/eq}
<form action="__APP__/Article/update.html" class="child-form page-list-form layui-form layui-form-pane" method="post">
	<div class="layui-form-item">
		<label class="layui-form-label">标题</label>
		<div class="layui-input-inline input-6x">
			{html:input type="text" name="title" value="｛$vo.title｝" autocomplete="off" placeholder="请填写标题" /}
		</div>
	</div>
	<div class="layui-form-item">
		<label class="layui-form-label">分类</label>
		<div class="layui-input-inline input-6x">
			<select name="cid">
				<option value="">请选择分类</option>
				{Data:loop name="Category" var="gvo" status="1" module="Article"}
				<option value="{$gvo.id}" {eq name="vo.cid" value="$gvo['id']" } selected="selected" {/eq}>{$gvo.title}</option>
				{/Data:loop}
			</select>
		</div>
	</div>
	<div class="layui-form-item">
		<label class="layui-form-label">封面</label>
		<div class="layui-input-inline input-6x">
			{Html:upload name="img" value="｛$vo.img｝"}
		</div>
	</div>
	<div class="layui-form-item layui-form-text">
		<!--label class="layui-form-label">内容</label-->
		<div class="layui-input-block">
			{Html:textarea name="content" id="editor" value="[$vo.content]" /}
		</div>
	</div>
	<div class="layui-form-item">
		<label class="layui-form-label">标签</label>
		<div class="layui-input-inline input-6x">
			<div style="display:flex">
				{html:input type="text" name="tags" value="｛$vo.tags｝" autocomplete="off" placeholder="请填写标签" /}
				<button type="button" id="analysisTags" class="layui-btn">分析</button>
			</div>
		</div>
	</div>
	<div class="layui-form-item">
		<label class="layui-form-label">状态</label>
		<div class="layui-input-inline input-6x">
			{Html:Switch name="status" value="1" options="启用|禁用" /}
		</div>
	</div>
	<div class="layui-form-item">
		<label class="layui-form-label">排序</label>
		<div class="layui-input-inline input-6x">
			<input type="text" class="layui-input" name="sort" value="{$vo.sort}" autocomplete="off" placeholder="请填写排序数字" />
		</div>
	</div>
	<div class="layui-form-item">
		<div class="layui-input-block">
			<button type="submit" class="layui-btn" lay-submit="" lay-filter="formSubmit">提交</button>
		</div>
	</div>
	<input type="hidden" name="id" value="{$vo.id}" />
</form>
{include file="common@fe" id="editor"/}
<script>
	layui.use('jquery',function(){
		var $ = layui.jquery;
		$('#analysisTags').click(function(){
			$.post('/Article/analysisTags.html',{title:$('#title').val(),content:$('#editor').val()},function(res){
				$('#tags').val($('#tags').val()+res);
				//console.log(res);
			});
		})
	});
</script>
<!-- 
<script src="__STATIC__/plugins/NKeditor/NKeditor-all-min.js"></script>
<script>
	layui.use(['jquery'], function(e) {
		window.jQuery = window.$ = $ = jQuery= layui.jquery;
		layui.use('editor');
	});
</script> -->